//
//  AppRouterSingleton.swift
//  SwiftUI+MVVM+Repository
//
//  Created by 高强 on 2024/9/11.
//

import SwiftUI

class AppRouterSingleton {
    static let shared = AppRouterSingleton()
    
    @ObservedObject var router = AppRouter()
    
    private init() {} // 防止外部初始化
    
    func getRootView() -> some View {
        return Group {
            switch router.currentRoute {
            case .login:
                LoginView(viewModel: LoginViewModel())
            case .content:
                ContentView(router: router)
            case .profile:
                Text("个人资料页面")
            }
        }
    }
}
